package com.tc.common.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.tc.common.model.enums.RecordStatusEnum;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import java.io.Serializable;
import java.util.Date;

/**
 * @Auther: tianchao
 * @Date: 2020/4/22 14:04
 * @Description:
 */
@Data
@Accessors(chain = true)
public abstract class BaseEntity implements Serializable {
    /**
     * 创建日期
     */
    @Column(name = "create_date")
    protected Date createDate;

    /**
     * 创建人
     */
    //@TableField(fill = FieldFill.INSERT)
    @Column(name = "create_by")
    protected String createBy;

    /**
     * 最后修改日期
     */
    @Column(name = "update_date")
    protected Date updateDate;

    /**
     * 最后修改人
     */
    //@TableField(fill = FieldFill.UPDATE)
    @Column(name = "update_by")
    protected String updateBy;

    /**
     * 备注
     */
    //@Length(max = 100, message = "备注长度不能超过100")
    protected String remark;

    /**
     * 记录状态
     */
    @JSONField(serialzeFeatures= SerializerFeature.WriteEnumUsingToString)
    @Column(name = "delete_flag")
    protected RecordStatusEnum deleteFlag;
}
